﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SouthKoreaCoffee.RobotModel
{
    public class RobotModelLeft
    {
        private static RobotModelLeft instance;
        private RobotModelLeft() { }
        public static RobotModelLeft Instance
        {
            get
            {
                if (instance == null)
                {
                    instance = new RobotModelLeft();
                }
                return instance;
            }
        }
        #region 机器人左臂操作
        /// <summary>
        /// 制作咖啡左 开 8
        /// </summary>
        public void RobotKFJL_UP()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)40, true);
            }
            catch
            {
            }
        }
        /// <summary>
        /// 制作咖啡左 关 8
        /// </summary>
        public void RobotKFJL_Down()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)40, false);
            }
            catch
            {
            }
        }
        /// <summary>
        /// 只接咖啡机 开 9
        /// </summary>
        public void RobotZJKFJ_UP()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)41, true);
            }
            catch
            {
            }
        }
        /// <summary>
        /// 只接咖啡机 关 9
        /// </summary>
        public void RobotZJKFJ_Down()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)41, false);
            }
            catch
            {
            }
        }
        /// <summary>
        /// 加冰品 开 10
        /// </summary>
        public void RobotJBP_UP()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)42, true);
            }
            catch
            {
            }
        }
        /// <summary>
        /// 加冰品 关 10
        /// </summary>
        public void RobotJBP_Down()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)42, false);
            }
            catch
            {
            }
        }
        /// <summary>
        /// 只接果糖冰水品 开 11
        /// </summary>
        public void RobotZJGTBSP_UP()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)43, true);
            }
            catch
            {
            }
        }
        /// <summary>
        /// 只接果糖冰水品 关 11
        /// </summary>
        public void RobotZJGTBSP_Down()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)43, false);
            }
            catch
            {
            }
        }
        /// <summary>
        /// 去杯检测 开 12
        /// </summary>
        public void RobotQBJC_UP()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)44, true);
            }
            catch
            {
            }
        }
        /// <summary>
        /// 去杯检测 关 12
        /// </summary>
        public void RobotQBJC_Down()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)44, false);
            }
            catch
            {
            }
        }
        /// <summary>
        /// 无杯通知 开 13
        /// </summary>
        public void RobotWBTZ_UP()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)45, true);
            }
            catch
            {
            }
        }
        /// <summary>
        /// 无杯通知 关 13
        /// </summary>
        public void RobotWBTZ_Down()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)45, false);
            }
            catch
            {
            }
        }
        /// <summary>
        /// 接杯成功 开 14
        /// </summary>
        public void RobotJBCG_UP()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)46, true);
            }
            catch
            {
            }
        }
        /// <summary>
        /// 接杯成功 关 14
        /// </summary>
        public void RobotJBCG_Down()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)46, false);
            }
            catch
            {
            }
        }
        /// <summary>
        /// 去接杯1 开 15
        /// </summary>
        public void RobotQJB1_UP()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)47, true);
            }
            catch
            {
            }
        }
        /// <summary>
        /// 去接杯1 关 15
        /// </summary>
        public void RobotQJB1_Down()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)47, false);
            }
            catch
            {
            }
        }
        /// <summary>
        /// 去接杯2 开 16
        /// </summary>
        public void RobotQJB2_UP()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)48, true);
            }
            catch
            {
            }
        }
        /// <summary>
        /// 去接杯2 关 16
        /// </summary>
        public void RobotQJB2_Down()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)48, false);
            }
            catch
            {
            }
        }
        /// <summary>
        /// 去接果糖 开 17
        /// </summary>
        public void RobotQJGT_UP()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)49, true);
            }
            catch
            {
            }
        }
        /// <summary>
        /// 去接果糖 关 17
        /// </summary>
        public void RobotQJGT_Down()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)49, false);
            }
            catch
            {
            }
        }
        /// <summary>
        /// 去制冰机 开 18
        /// </summary>
        public void RobotQZBJ_UP()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)50, true);
            }
            catch
            {
            }
        }
        /// <summary>
        /// 去制冰机 关 18
        /// </summary>
        public void RobotQZBJ_Down()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)50, false);
            }
            catch
            {
            }
        }
        /// <summary>
        /// 去咖啡机 开 19
        /// </summary>
        public void RobotQKFJ_UP()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)51, true);
            }
            catch
            {
            }
        }
        /// <summary>
        /// 去咖啡机 关 19
        /// </summary>
        public void RobotQKFJ_Down()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)51, false);
            }
            catch
            {
            }
        }
        /// <summary>
        /// 去接盖 开 20
        /// </summary>
        public void RobotQJG_UP()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)52, true);
            }
            catch
            {
            }
        }
        /// <summary>
        /// 去接盖 关 20
        /// </summary>
        public void RobotQJG_Down()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)52, false);
            }
            catch
            {
            }
        }
        /// <summary>
        /// 去压盖 开 21
        /// </summary>
        public void RobotQYG_UP()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)53, true);
            }
            catch
            {
            }
        }
        /// <summary>
        /// 去压盖 关 21
        /// </summary>
        public void RobotQYG_Down()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)53, false);
            }
            catch
            {
            }
        }
        /// <summary>
        /// 去出餐口1 开 22
        /// </summary>
        public void RobotQCCK1_UP()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)54, true);
            }
            catch
            {
            }
        }
        /// <summary>
        /// 去出餐口1 关 22
        /// </summary>
        public void RobotQCCK1_Down()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)54, false);
            }
            catch
            {
            }
        }
        /// <summary>
        /// 去出餐口2 开 23
        /// </summary>
        public void RobotQCCK2_UP()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)55, true);
            }
            catch
            {
            }
        }
        /// <summary>
        /// 去出餐口2 关 23
        /// </summary>
        public void RobotQCCK2_Down()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)55, false);
            }
            catch
            {
            }
        }
        /// <summary>
        /// 接杯完成 开 24
        /// </summary>
        public void RobotJBWC_UP()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)56, true);
            }
            catch
            {
            }
        }
        /// <summary>
        /// 接杯完成 关 24
        /// </summary>
        public void RobotJBWC_Down()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)56, false);
            }
            catch
            {
            }
        }
        /// <summary>
        /// 接果糖完成 开 25
        /// </summary>
        public void RobotJGTWC_UP()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)57, true);
            }
            catch
            {
            }
        }
        /// <summary>
        /// 接果糖完成 关 25
        /// </summary>
        public void RobotJGTWC_Down()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)57, false);
            }
            catch
            {
            }
        }
        /// <summary>
        /// 接冰完成 开 26
        /// </summary>
        public void RobotJBWC2_UP()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)58, true);
            }
            catch
            {
            }
        }
        /// <summary>
        /// 接冰完成 关 26
        /// </summary>
        public void RobotJBWC2_Down()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)58, false);
            }
            catch
            {
            }
        }
        /// <summary>
        /// 接咖啡完成 开 27
        /// </summary>
        public void RobotJKFWC_UP()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)59, true);
            }
            catch
            {
            }
        }
        /// <summary>
        /// 接咖啡完成 关 27
        /// </summary>
        public void RobotJKFWC_Down()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)59, false);
            }
            catch
            {
            }
        }
        /// <summary>
        /// 机器人停止运行左 开 45
        /// </summary>
        public void RobotJQRTZYXL_UP()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)77, true);
            }
            catch
            {
            }
        }
        /// <summary>
        ///  机器人停止运行左 关 45
        /// </summary>
        public void RobotJQRTZYXL_Down()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)77, false);
            }
            catch
            {
            }
        }
        /// <summary>
        /// 机器人运行左 开 46
        /// </summary>
        public void RobotJQRYXL_UP()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)78, true);
            }
            catch
            {
            }
        }
        /// <summary>
        ///  机器人运行左 关 46
        /// </summary>
        public void RobotJQRYXL_Down()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)78, false);
            }
            catch
            {
            }
        }
        /// <summary>
        /// 机器人报警确认左 开 47
        /// </summary>
        public void RobotJQRBJQRL_UP()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)79, true);
            }
            catch
            {
            }
        }
        /// <summary>
        ///  机器人报警确认左 关 47
        /// </summary>
        public void RobotJQRBJQRL_Down()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)79, false);
            }
            catch
            {
            }
        }
        /// <summary>
        /// 机器人上电左 开 48
        /// </summary>
        public void RobotJQRSDL_UP()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)80, true);
            }
            catch
            {
            }
        }
        /// <summary>
        ///  机器人上电左 关 48
        /// </summary>
        public void RobotJQRSDL_Down()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)80, false);
            }
            catch
            {
            }
        }
        /// <summary>
        /// 机器人下电左 开 49
        /// </summary>
        public void RobotJQRXDL_UP()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)81, true);
            }
            catch
            {
            }
        }
        /// <summary>
        ///  机器人下电左 关 49
        /// </summary>
        public void RobotJQRXDL_Down()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)81, false);
            }
            catch
            {
            }
        }
        /// <summary>
        /// 机器人使能左 开 50
        /// </summary>
        public void RobotJQRSNL_UP()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)82, true);
            }
            catch
            {
            }
        }
        /// <summary>
        ///  机器人使能左 关 50
        /// </summary>
        public void RobotJQRSNL_Down()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)82, false);
            }
            catch
            {
            }
        }
        /// <summary>
        /// 机器人下使能左 开 511
        /// </summary>
        public void RobotJQRXSNL_UP()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)83, true);
            }
            catch
            {
            }
        }
        /// <summary>
        ///  机器人下使能左 关 51
        /// </summary>
        public void RobotJQRXSNL_Down()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)83, false);
            }
            catch
            {
            }
        }
        /// <summary>
        /// 机器人暂停左 开 52
        /// </summary>
        public void RobotJQRZTL_UP()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)84, true);
            }
            catch
            {
            }
        }
        /// <summary>
        ///  机器人暂停左 关 52
        /// </summary>
        public void RobotJQRZTL_Down()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)84, false);
            }
            catch
            {
            }
        }
        /// <summary>
        /// 机器人继续运行左 开 53
        /// </summary>
        public void RobotJQRJXYXL_UP()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)85, true);
            }
            catch
            {
            }
        }
        /// <summary>
        ///  机器人继续运行左 关 53
        /// </summary>
        public void RobotJQRJXYXL_Down()
        {
            try
            {
                RobotSerialPortLeft.Instance.WriteSingleCoil(1, (ushort)85, false);
            }
            catch
            {
            }
        }
        #endregion
        #region 机器人左臂查询
        /// <summary>
        /// 到原点 8
        /// </summary>
        public bool LRobotDYD_Sel()
        {
            try
            {
                return RobotSerialPortLeft.Instance.ReadDiscreteInputs(1, (ushort)8, (ushort)1)[0];
            }
            catch
            {
                return false;
            }
        }
        /// <summary>
        /// 到落杯器 9
        /// </summary>
        public bool LRobotDLBQ_Sel()
        {
            try
            {
                return RobotSerialPortLeft.Instance.ReadDiscreteInputs(1, (ushort)9, (ushort)1)[0];
            }
            catch
            {
                return false;
            }
        }
        /// <summary>
        /// 到接杯检测点 10
        /// </summary>
        public bool LRobotDJBJCD_Sel()
        {
            try
            {
                return RobotSerialPortLeft.Instance.ReadDiscreteInputs(1, (ushort)10, (ushort)1)[0];
            }
            catch
            {
                return false;
            }
        }
        /// <summary>
        /// 到果糖点 11
        /// </summary>
        public bool LRobotDGTD_Sel()
        {
            try
            {
                return RobotSerialPortLeft.Instance.ReadDiscreteInputs(1, (ushort)11, (ushort)1)[0];
            }
            catch
            {
                return false;
            }
        }
        /// <summary>
        /// 到制冰机 12
        /// </summary>
        public bool LRobotDZBJ_Sel()
        {
            try
            {
                return RobotSerialPortLeft.Instance.ReadDiscreteInputs(1, (ushort)12, (ushort)1)[0];
            }
            catch
            {
                return false;
            }
        }
        /// <summary>
        /// 到咖啡机 13
        /// </summary>
        public bool LRobotDKFJ_Sel()
        {
            try
            {
                return RobotSerialPortLeft.Instance.ReadDiscreteInputs(1, (ushort)13, (ushort)1)[0];
            }
            catch
            {
                return false;
            }
        }
        /// <summary>
        /// 到接盖点 14
        /// </summary>
        public bool LRobotDJGD_Sel()
        {
            try
            {
                return RobotSerialPortLeft.Instance.ReadDiscreteInputs(1, (ushort)14, (ushort)1)[0];
            }
            catch
            {
                return false;
            }
        }
        /// <summary>
        /// 到压盖点 15
        /// </summary>
        public bool LRobotDYGD_Sel()
        {
            try
            {
                return RobotSerialPortLeft.Instance.ReadDiscreteInputs(1, (ushort)15, (ushort)1)[0];
            }
            catch
            {
                return false;
            }
        }
        /// <summary>
        /// 交付完成 16
        /// </summary>
        public bool LRobotJFWC_Sel()
        {
            try
            {
                return RobotSerialPortLeft.Instance.ReadDiscreteInputs(1, (ushort)16, (ushort)1)[0];
            }
            catch
            {
                return false;
            }
        }
        ///// <summary>
        /////到果糖点 17
        ///// </summary>
        //public bool LRobotDGTD_Sel()
        //{
        //    try
        //    {
        //        return RobotSerialPortLeft.Instance.ReadDiscreteInputs(1, (ushort)17, (ushort)1)[0];
        //    }
        //    catch
        //    {
        //        return false;
        //    }
        //}
        ///// <summary>
        ///// 招手完成 18
        ///// </summary>
        //public bool LRobotZSWC_Sel()
        //{
        //    try
        //    {
        //        return RobotSerialPortLeft.Instance.ReadDiscreteInputs(1, (ushort)18, (ushort)1)[0];
        //    }
        //    catch
        //    {
        //        return false;
        //    }
        //}
        /// <summary>
        /// 机器人1运行 30
        /// </summary>
        public bool LRobotJQRYX_Sel()
        {
            try
            {
                return RobotSerialPortLeft.Instance.ReadDiscreteInputs(1, (ushort)45, (ushort)1)[0];
            }
            catch
            {
                return false;
            }
        }
        /// <summary>
        /// 机器人1报警 31
        /// </summary>
        public bool LRobotJQRBJ_Sel()
        {
            try
            {
                return RobotSerialPortLeft.Instance.ReadDiscreteInputs(1, (ushort)46, (ushort)1)[0];
            }
            catch
            {
                return false;
            }
        }
        /// <summary>
        /// 机器人1急停 32
        /// </summary>
        public bool LRobotQJRJT_Sel()
        {
            try
            {
                return RobotSerialPortLeft.Instance.ReadDiscreteInputs(1, (ushort)47, (ushort)1)[0];
            }
            catch
            {
                return false;
            }
        }
        /// <summary>
        /// 机器人1已开机 33
        /// </summary>
        public bool LRobotJQRYKJ_Sel()
        {
            try
            {
                return RobotSerialPortLeft.Instance.ReadDiscreteInputs(1, (ushort)48, (ushort)1)[0];
            }
            catch
            {
                return false;
            }
        }
        /// <summary>
        /// 机器人1已上电 34
        /// </summary>
        public bool LRobotJQRYSD_Sel()
        {
            try
            {
                return RobotSerialPortLeft.Instance.ReadDiscreteInputs(1, (ushort)49, (ushort)1)[0];
            }
            catch
            {
                return false;
            }
        }
        /// <summary>
        /// 机器人1已使能 35
        /// </summary>
        public bool LRobotJQRYSN_Sel()
        {
            try
            {
                return RobotSerialPortLeft.Instance.ReadDiscreteInputs(1, (ushort)50, (ushort)1)[0];
            }
            catch
            {
                return false;
            }
        }
        /// <summary>
        /// 机器人1暂停 36
        /// </summary>
        public bool LRobotJQRZT_Sel()
        {
            try
            {
                return RobotSerialPortLeft.Instance.ReadDiscreteInputs(1, (ushort)51, (ushort)1)[0];
            }
            catch
            {
                return false;
            }
        }
        /// <summary>
        /// 机器人1运动中 37
        /// </summary>
        public bool LRobotJQRYDZ_Sel()
        {
            try
            {
                return RobotSerialPortLeft.Instance.ReadDiscreteInputs(1, (ushort)52, (ushort)1)[0];
            }
            catch
            {
                return false;
            }
        }
        #endregion
    }
}
